<template>
	<view class="viewBg">
		<!-- <mSearch :mode="2" button="outside" radius="5" @search="search($searchKey,2)"></mSearch> -->

		<view class="uni-list">
			<view class="uni-list-cell" v-for="(item,index) in list" :key="index" @click="goDetail(item)">
				<view class="uni-list-cell-navigate uni-navigate-right">
					{{item.title}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import mSearch from "@/components/mehaotian-search/mehaotian-search.vue";

	export default {
		components: {
			mSearch
		},
		data() {
			return {
				list: [],
				searchKey: '',
				current: 0,
				activeColor: '#007aff',
				styleType: 'button',

				reload: false,

				pageNo: 1,
				viewStatus: 0,
			};
		},
		onLoad() {
			this.getList();
		},
		onReachBottom() {
			this.pageNo++;
			this.getList();
		},
		methods: {
			getList() {
				this.reload = false;
				uni.stopPullDownRefresh();

				this.$http.get('ac/xagrid/appHelpService/getHelpList', {
					pageNo: this.pageNo,
					pageSize: 10,
					viewStatus: this.viewStatus
				}).then((res) => {
					if (res.errcode === '0') {
						const obj = res.data;
						if (obj.length > 0) {
							this.list = this.list.concat(obj);
						}
					} else {
						uni.showToast({
							title: res.errmsg,
							icon: 'none',
							duration: 1500
						});
					}
				});

			},
			goDetail(e) {
				uni.navigateTo({
					url: 'helpDetail/helpDetail?title=' + e.title + '&time=' + e.createTime+'&content='+e.content,
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.viewBg {
		width: 100%;
		height: 100%;
		/* background-color: #0FAEFF; */
	}

	.aaa {
		width: 100upx;
		height: 100upx;
		background-color: #007AFF;
	}
</style>
